$().ready(function() {
    $("#new_order").validate({
        errorElement: "em",
        errorContainer: $("#warning"),
        errorPlacement: function(error, element) {
            error.appendTo( element.next("span"));
        },
        success: function(label) {
            label.text("ok!").addClass("success");
        },
        rules: {
            "order[address_id]": {
                required: true
            },
            "order[shipping_type]": {
                required: true
            },
            "order[paytype]": {
                required: true
            }
        },
        messages: {
            "order[address_id]": {
                required: "必选"
            },
            "order[shipping_type]": {
                required: "必选"
            },
            "order[paytype]": {
                required: "必选"
            }

        }

    });
});